Page({
  data: {
    url: '',
    statusBarHeight: 0,
    pageTitle: '玩真的用户服务协议'
  },

  onLoad(options) {
    const windowInfo = wx.getWindowInfo();
    this.setData({
      statusBarHeight: windowInfo.statusBarHeight
    });

    const { type } = options;
    let url = '';
    let pageTitle = '玩真的用户服务协议';
    
    if (type === 'privacy') {
      url = 'http://app.playtruly.cn/%E9%9A%90%E7%A7%81%E6%94%BF%E7%AD%96.html';
      pageTitle = '隐私政策';
    } else if (type === 'manual') {
      url = 'http://app.playtruly.cn/%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C.html';
      pageTitle = '用户手册';
    }
    
    this.setData({ 
      url,
      pageTitle
    });
  },

  // 返回
  goBack() {
    wx.navigateBack();
  }
});

